﻿/*
* @autor: hectorea
* @date: 12/07/2012
* @programming interview 8
*/

using System;
using System.Text;

namespace FibonacciNumber
{
    /// <summary>
    /// Programming Interview 8: Write a method to calculate the Fibonacci number.
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            do
            {
                Console.Clear();

                StringBuilder sb = new StringBuilder();
                sb.Append("Please type an integer number: ");

                Console.Write(sb.ToString());

                int number = int.Parse(Console.ReadLine());

                Console.Write("The Fibonacci number of {0} is: {1}", number, number.FibonacciNumber());
                Console.WriteLine();

                Console.Write("and the Fibonacci sequence is:");

                number.FibonacciSequence();

                Console.WriteLine();
                Console.WriteLine("Please type any key to continue testing or [X] to exit");

            } while (!Console.ReadLine().ToUpper().Equals("X"));
        }
    }
}